const axios = require('axios');

const appID = 'wxecc9322469a3f41b';
const appSecret = '7803a7c5261cd59ce2fcc64b7d212b4f';

// 获取 Access Token
async function getAccessToken() {
  try {
    const response = await axios.get(`https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=${appID}&secret=${appSecret}`);
    const accessToken = response.data.access_token;
    console.log('accessToken', accessToken)
    return accessToken;
  } catch (error) {
    console.error('Error getting access token:', error.message);
    return null;
  }
}